package com.example.common.util;

public record ResultCodeRecord(Integer code, String message) {
    // 成功段固定为200
    public static ResultCodeRecord SUCCESS = new ResultCodeRecord(200,"操作成功");
    // 失败段固定位201
    public static ResultCodeRecord ERROR = new ResultCodeRecord(201, "操作失败");
    // 登录段1~50
    public static ResultCodeRecord NEED_LOGIN = new ResultCodeRecord(1,"需要登录后操作");
    public static ResultCodeRecord LOGIN_PASSWORD_ERROR = new ResultCodeRecord(2,"密码错误");
    // TOKEN50~100
    public static ResultCodeRecord TOKEN_INVALID = new ResultCodeRecord(50,"无效的TOKEN");
    public static ResultCodeRecord TOKEN_EXPIRE = new ResultCodeRecord(51,"TOKEN已过期");
    public static ResultCodeRecord TOKEN_REQUIRE = new ResultCodeRecord(52,"TOKEN是必须的");
    // SIGN验签 100~120
    public static ResultCodeRecord SIGN_INVALID = new ResultCodeRecord(100,"无效的SIGN");
    public static ResultCodeRecord SIG_TIMEOUT = new ResultCodeRecord(101,"SIGN已过期");
    // 参数错误 500~1000
    public static ResultCodeRecord PARAM_REQUIRE = new ResultCodeRecord(500,"缺少参数");
    public static ResultCodeRecord PARAM_INVALID = new ResultCodeRecord(501,"无效参数");
    public static ResultCodeRecord PARAM_IMAGE_FORMAT_ERROR = new ResultCodeRecord(502,"图片格式有误");
    public static ResultCodeRecord SERVER_ERROR = new ResultCodeRecord(503,"服务器内部错误");
    // 数据错误 1000~2000
    public static ResultCodeRecord DATA_EXIST = new ResultCodeRecord(1000,"数据已经存在");
    public static ResultCodeRecord AP_USER_DATA_NOT_EXIST = new ResultCodeRecord(1001,"ApUser数据不存在");
    public static ResultCodeRecord DATA_NOT_EXIST = new ResultCodeRecord(1002,"数据不存在");
    // 数据错误 3000~3500
    public static ResultCodeRecord NO_OPERATOR_AUTH = new ResultCodeRecord(3000,"无权限操作");
    public static ResultCodeRecord NEED_ADMIND = new ResultCodeRecord(3001,"需要管理员权限");
}
